package core;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Lookup {
    
	public static ManagerLocal lookupManager() {
        try {
            Context c = new InitialContext();
            return (ManagerLocal) c.lookup("local/Manager");
        } catch (NamingException ne) {
            throw new RuntimeException(ne);
        }
    }	

	public static MemberManagerLocal lookupMemberManager() {
        try {
            Context c = new InitialContext();
            return (MemberManagerLocal) c.lookup("local/MemberManager");
        } catch (NamingException ne) {
            throw new RuntimeException(ne);
        }
    }	
	
	public static NearbyServicesLocal lookupNearbyServices() {
        try {
            Context c = new InitialContext();
            return (NearbyServicesLocal) c.lookup("local/NearbyServices");
        } catch (NamingException ne) {
            throw new RuntimeException(ne);
        }
    }	

	
	public static GeocoderLocal lookupGeocoder() {
        try {
            Context c = new InitialContext();
            return (GeocoderLocal) c.lookup("local/Geocoder");
        } catch (NamingException ne) {
            throw new RuntimeException(ne);
        }
    }	
}
